function createCanvas(clientWidth: number, clientHeight: number) {
  const canvas = document.createElement('canvas');
  // 为什么要乘上 devicePixelRatio 是因为；在高分屏（移动端设备）如果不乘比例渲染出来的图像就会变得模糊
  canvas.width = clientWidth * devicePixelRatio;
  canvas.height = clientHeight * devicePixelRatio;
  // 乘上比例后canvas的宽高就会很大，可以通过style在给重置回去

  canvas.style.width = `${clientWidth}px`;
  canvas.style.height = `${clientHeight}px`;

  return canvas;
}

export { createCanvas };
